<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Home</title>
</head>
<body>
    <h2>Home</h2>
    <hr>

    {#  模板语言的注释   #}

    <h4>变量：</h4>
    <p>name: {{ name }}</p>
    <p>age: {{ age }}</p>
    <p>likes: {{ likes }}</p>

    <hr>
    <h4>标签：</h4>
    <h5>if语句</h5>
    {% if age >= 18 %}
        <p>{{ name }}已经成年了</p>
    {% elif age >= 6 %}
        <p>{{ name }}可以上学了</p>
    {% else %}
        <p>{{ name }} 还是小孩 </p>
    {% endif %}

    <h5>for循环</h5>
    {% for like in likes %}

        {% if loop.first %}
            <p style="color: red;">{{ like }}</p>
        {% elif loop.last %}
            <p style="color: blue;">{{ like }}</p>
        {% else %}
            <p>{{ like }}</p>
        {% endif %}

        index: {{ loop.index }},
        index0: {{ loop.index0 }},
        revindex: {{ loop.revindex }},
        revindex0: {{ loop.revindex0 }}

    {% else %}
        <b>else</b>
    {% endfor %}




    <br><br><br><br><br>
    <br><br><br><br><br>
    <br><br><br><br><br>
</body>
</html>